package cn.globalph.housekeeper.data.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by homelajiang on 2017/2/15 0015.
 */

public class UpdateModel implements Parcelable {

    /**
     * appcode : AIMI
     * appurl : http://rrm-1251323512.cossh.myqcloud.com/aimi_app/app-release_v1.0.2.apk
     * createby : system
     * createon : 2017-08-21
     * delind : N
     * forceUpdate : true
     * minversioncode : 2
     * modifyby : system
     * modifyon : 2017-08-21
     * HTTP_HEADER : android
     * remarks :
     * uuid : 2017082100000002
     * versioncode : 3
     * versionno : 1
     */

    private String appcode;
    private String appurl;
    private String createby;
    private String createon;
    private String delind;
    private boolean forceUpdate;
    private boolean skipAllowed;
    private int minversioncode;
    private String modifyby;
    private String modifyon;
    private String platform;
    private String remarks;
    private String uuid;
    private int versioncode;
    private int versionno;

    public boolean isSkipAllowed() {
        return skipAllowed;
    }

    public void setSkipAllowed(boolean skipAllowed) {
        this.skipAllowed = skipAllowed;
    }

    public String getAppcode() {
        return appcode;
    }

    public void setAppcode(String appcode) {
        this.appcode = appcode;
    }

    public String getAppurl() {
        return appurl;
    }

    public void setAppurl(String appurl) {
        this.appurl = appurl;
    }

    public String getCreateby() {
        return createby;
    }

    public void setCreateby(String createby) {
        this.createby = createby;
    }

    public String getCreateon() {
        return createon;
    }

    public void setCreateon(String createon) {
        this.createon = createon;
    }

    public String getDelind() {
        return delind;
    }

    public void setDelind(String delind) {
        this.delind = delind;
    }

    public boolean isForceUpdate() {
        return forceUpdate;
    }

    public void setForceUpdate(boolean forceUpdate) {
        this.forceUpdate = forceUpdate;
    }

    public int getMinversioncode() {
        return minversioncode;
    }

    public void setMinversioncode(int minversioncode) {
        this.minversioncode = minversioncode;
    }

    public String getModifyby() {
        return modifyby;
    }

    public void setModifyby(String modifyby) {
        this.modifyby = modifyby;
    }

    public String getModifyon() {
        return modifyon;
    }

    public void setModifyon(String modifyon) {
        this.modifyon = modifyon;
    }

    public String getPlatform() {
        return platform;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public int getVersioncode() {
        return versioncode;
    }

    public void setVersioncode(int versioncode) {
        this.versioncode = versioncode;
    }

    public int getVersionno() {
        return versionno;
    }

    public void setVersionno(int versionno) {
        this.versionno = versionno;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.appcode);
        dest.writeString(this.appurl);
        dest.writeString(this.createby);
        dest.writeString(this.createon);
        dest.writeString(this.delind);
        dest.writeByte(this.forceUpdate ? (byte) 1 : (byte) 0);
        dest.writeByte(this.skipAllowed ? (byte) 1 : (byte) 0);
        dest.writeInt(this.minversioncode);
        dest.writeString(this.modifyby);
        dest.writeString(this.modifyon);
        dest.writeString(this.platform);
        dest.writeString(this.remarks);
        dest.writeString(this.uuid);
        dest.writeInt(this.versioncode);
        dest.writeInt(this.versionno);
    }

    public UpdateModel() {
    }

    protected UpdateModel(Parcel in) {
        this.appcode = in.readString();
        this.appurl = in.readString();
        this.createby = in.readString();
        this.createon = in.readString();
        this.delind = in.readString();
        this.forceUpdate = in.readByte() != 0;
        this.skipAllowed = in.readByte() != 0;
        this.minversioncode = in.readInt();
        this.modifyby = in.readString();
        this.modifyon = in.readString();
        this.platform = in.readString();
        this.remarks = in.readString();
        this.uuid = in.readString();
        this.versioncode = in.readInt();
        this.versionno = in.readInt();
    }

    public static final Creator<UpdateModel> CREATOR = new Creator<UpdateModel>() {
        @Override
        public UpdateModel createFromParcel(Parcel source) {
            return new UpdateModel(source);
        }

        @Override
        public UpdateModel[] newArray(int size) {
            return new UpdateModel[size];
        }
    };
}
